package com.jiajia.study.nio.chapter03;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.StandardCharsets;

public class MyClientV2 {
    public static void main(String[] args) throws IOException {
        SocketChannel socketChannel = SocketChannel.open();
        socketChannel.connect(new InetSocketAddress(8777));
        socketChannel.write(StandardCharsets.UTF_8.encode("hellosuns\n"));
        socketChannel.close();

    }
}
